using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Navigation;
using System.Windows.Threading;
namespace Clarity.Phone.Extensions
{
	public class DialogService
	{
		public enum AnimationTypes
		{
			Slide,
			SlideHorizontal,
			Swivel,
			SwivelHorizontal
		}
		[CompilerGenerated]
		private sealed class Class26
		{
			public Storyboard storyboard_0;
			public DialogService dialogService_0;
			public void method_0()
			{
				using (IEnumerator<Timeline> enumerator = this.storyboard_0.get_Children().GetEnumerator())
				{
					while (enumerator.MoveNext())
					{
						Timeline current = enumerator.get_Current();
						Storyboard.SetTarget(current, this.dialogService_0.panel_1);
					}
				}
				this.storyboard_0.Begin();
			}
		}
		private const string string_0 = "\r\n        <Storyboard  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\r\n            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=\"(UIElement.RenderTransform).(TranslateTransform.Y)\">\r\n                <EasingDoubleKeyFrame KeyTime=\"0\" Value=\"150\"/>\r\n                <EasingDoubleKeyFrame KeyTime=\"0:0:0.35\" Value=\"0\">\r\n                    <EasingDoubleKeyFrame.EasingFunction>\r\n                        <ExponentialEase EasingMode=\"EaseOut\" Exponent=\"6\"/>\r\n                    </EasingDoubleKeyFrame.EasingFunction>\r\n                </EasingDoubleKeyFrame>\r\n            </DoubleAnimationUsingKeyFrames>\r\n            <DoubleAnimation Storyboard.TargetProperty=\"(UIElement.Opacity)\" From=\"0\" To=\"1\" Duration=\"0:0:0.350\">\r\n                <DoubleAnimation.EasingFunction>\r\n                    <ExponentialEase EasingMode=\"EaseOut\" Exponent=\"6\"/>\r\n                </DoubleAnimation.EasingFunction>\r\n            </DoubleAnimation>\r\n        </Storyboard>";
		private const string string_1 = "\r\n        <Storyboard  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\r\n            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=\"(UIElement.RenderTransform).(TranslateTransform.X)\" >\r\n                    <EasingDoubleKeyFrame KeyTime=\"0\" Value=\"-150\"/>\r\n                    <EasingDoubleKeyFrame KeyTime=\"0:0:0.35\" Value=\"0\">\r\n                        <EasingDoubleKeyFrame.EasingFunction>\r\n                            <ExponentialEase EasingMode=\"EaseOut\" Exponent=\"6\"/>\r\n                        </EasingDoubleKeyFrame.EasingFunction>\r\n                    </EasingDoubleKeyFrame>\r\n                </DoubleAnimationUsingKeyFrames>\r\n            <DoubleAnimation Storyboard.TargetProperty=\"(UIElement.Opacity)\" From=\"0\" To=\"1\" Duration=\"0:0:0.350\" >\r\n                <DoubleAnimation.EasingFunction>\r\n                    <ExponentialEase EasingMode=\"EaseOut\" Exponent=\"6\"/>\r\n                </DoubleAnimation.EasingFunction>\r\n            </DoubleAnimation>\r\n        </Storyboard>";
		private const string string_2 = "\r\n        <Storyboard  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\r\n            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=\"(UIElement.RenderTransform).(TranslateTransform.X)\">\r\n                <EasingDoubleKeyFrame KeyTime=\"0\" Value=\"0\"/>\r\n                <EasingDoubleKeyFrame KeyTime=\"0:0:0.25\" Value=\"150\">\r\n                    <EasingDoubleKeyFrame.EasingFunction>\r\n                        <ExponentialEase EasingMode=\"EaseIn\" Exponent=\"6\"/>\r\n                    </EasingDoubleKeyFrame.EasingFunction>\r\n                </EasingDoubleKeyFrame>\r\n            </DoubleAnimationUsingKeyFrames>\r\n            <DoubleAnimation Storyboard.TargetProperty=\"(UIElement.Opacity)\" From=\"1\" To=\"0\" Duration=\"0:0:0.25\">\r\n                <DoubleAnimation.EasingFunction>\r\n                    <ExponentialEase EasingMode=\"EaseIn\" Exponent=\"6\"/>\r\n                </DoubleAnimation.EasingFunction>\r\n            </DoubleAnimation>\r\n        </Storyboard>";
		private const string string_3 = "\r\n        <Storyboard  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\r\n            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=\"(UIElement.RenderTransform).(TranslateTransform.Y)\">\r\n                <EasingDoubleKeyFrame KeyTime=\"0\" Value=\"0\"/>\r\n                <EasingDoubleKeyFrame KeyTime=\"0:0:0.25\" Value=\"150\">\r\n                    <EasingDoubleKeyFrame.EasingFunction>\r\n                        <ExponentialEase EasingMode=\"EaseIn\" Exponent=\"6\"/>\r\n                    </EasingDoubleKeyFrame.EasingFunction>\r\n                </EasingDoubleKeyFrame>\r\n            </DoubleAnimationUsingKeyFrames>\r\n            <DoubleAnimation Storyboard.TargetProperty=\"(UIElement.Opacity)\" From=\"1\" To=\"0\" Duration=\"0:0:0.25\">\r\n                <DoubleAnimation.EasingFunction>\r\n                    <ExponentialEase EasingMode=\"EaseIn\" Exponent=\"6\"/>\r\n                </DoubleAnimation.EasingFunction>\r\n            </DoubleAnimation>\r\n        </Storyboard>";
		private const string string_4 = "<Storyboard xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\r\n            <DoubleAnimation BeginTime=\"0:0:0\" Duration=\"0\" To=\".5\"\r\n                                Storyboard.TargetProperty=\"(UIElement.Projection).(PlaneProjection.CenterOfRotationY)\" />\r\n            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=\"(UIElement.Projection).(PlaneProjection.RotationX)\">\r\n                <EasingDoubleKeyFrame KeyTime=\"0\" Value=\"-30\"/>\r\n                <EasingDoubleKeyFrame KeyTime=\"0:0:0.35\" Value=\"0\">\r\n                    <EasingDoubleKeyFrame.EasingFunction>\r\n                        <ExponentialEase EasingMode=\"EaseOut\" Exponent=\"6\"/>\r\n                    </EasingDoubleKeyFrame.EasingFunction>\r\n                </EasingDoubleKeyFrame>\r\n            </DoubleAnimationUsingKeyFrames>\r\n            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=\"(UIElement.Opacity)\">\r\n                <DiscreteDoubleKeyFrame KeyTime=\"0\" Value=\"1\" />\r\n            </DoubleAnimationUsingKeyFrames>\r\n        </Storyboard>";
		private const string string_5 = "<Storyboard xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\r\n            <DoubleAnimation BeginTime=\"0:0:0\" Duration=\"0\" \r\n                                Storyboard.TargetProperty=\"(UIElement.Projection).(PlaneProjection.CenterOfRotationY)\" \r\n                                To=\".5\"/>\r\n            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=\"(UIElement.Projection).(PlaneProjection.RotationX)\">\r\n                <EasingDoubleKeyFrame KeyTime=\"0\" Value=\"0\"/>\r\n                <EasingDoubleKeyFrame KeyTime=\"0:0:0.25\" Value=\"45\">\r\n                    <EasingDoubleKeyFrame.EasingFunction>\r\n                        <ExponentialEase EasingMode=\"EaseIn\" Exponent=\"6\"/>\r\n                    </EasingDoubleKeyFrame.EasingFunction>\r\n                </EasingDoubleKeyFrame>\r\n            </DoubleAnimationUsingKeyFrames>\r\n            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=\"(UIElement.Opacity)\">\r\n                <DiscreteDoubleKeyFrame KeyTime=\"0\" Value=\"1\" />\r\n                <DiscreteDoubleKeyFrame KeyTime=\"0:0:0.267\" Value=\"0\" />\r\n            </DoubleAnimationUsingKeyFrames>\r\n        </Storyboard>";
		private Panel panel_0;
		private Frame frame_0;
		private PhoneApplicationPage phoneApplicationPage_0;
		private Panel panel_1;
		private EventHandler eventHandler_0;
		private EventHandler eventHandler_1;
		private bool bool_0;
		private static readonly object object_0 = new object();
		[CompilerGenerated]
		private FrameworkElement frameworkElement_0;
		[CompilerGenerated]
		private DialogService.AnimationTypes animationTypes_0;
		[CompilerGenerated]
		private double double_0;
		[CompilerGenerated]
		private Brush brush_0;
		[CompilerGenerated]
		private bool bool_1;
		[CompilerGenerated]
		private bool bool_2;
		[CompilerGenerated]
		private bool bool_3;
		public event EventHandler Closed
		{
			add
			{
				EventHandler eventHandler = this.eventHandler_0;
				EventHandler eventHandler2;
				do
				{
					eventHandler2 = eventHandler;
					EventHandler eventHandler3 = (EventHandler)Delegate.Combine(eventHandler2, value);
					eventHandler = Interlocked.CompareExchange<EventHandler>(ref this.eventHandler_0, eventHandler3, eventHandler2);
				}
				while (eventHandler != eventHandler2);
			}
			remove
			{
				EventHandler eventHandler = this.eventHandler_0;
				EventHandler eventHandler2;
				do
				{
					eventHandler2 = eventHandler;
					EventHandler eventHandler3 = (EventHandler)Delegate.Remove(eventHandler2, value);
					eventHandler = Interlocked.CompareExchange<EventHandler>(ref this.eventHandler_0, eventHandler3, eventHandler2);
				}
				while (eventHandler != eventHandler2);
			}
		}
		public event EventHandler Opened
		{
			add
			{
				EventHandler eventHandler = this.eventHandler_1;
				EventHandler eventHandler2;
				do
				{
					eventHandler2 = eventHandler;
					EventHandler eventHandler3 = (EventHandler)Delegate.Combine(eventHandler2, value);
					eventHandler = Interlocked.CompareExchange<EventHandler>(ref this.eventHandler_1, eventHandler3, eventHandler2);
				}
				while (eventHandler != eventHandler2);
			}
			remove
			{
				EventHandler eventHandler = this.eventHandler_1;
				EventHandler eventHandler2;
				do
				{
					eventHandler2 = eventHandler;
					EventHandler eventHandler3 = (EventHandler)Delegate.Remove(eventHandler2, value);
					eventHandler = Interlocked.CompareExchange<EventHandler>(ref this.eventHandler_1, eventHandler3, eventHandler2);
				}
				while (eventHandler != eventHandler2);
			}
		}
		public FrameworkElement Child
		{
			get;
			set;
		}
		public DialogService.AnimationTypes AnimationType
		{
			get;
			set;
		}
		public double VerticalOffset
		{
			get;
			set;
		}
		public Brush BackgroundBrush
		{
			get;
			set;
		}
		internal bool IsOpen
		{
			get;
			set;
		}
		protected internal bool IsBackKeyOverride
		{
			get;
			set;
		}
		public bool HasPopup
		{
			get;
			set;
		}
		internal PhoneApplicationPage Page
		{
			get
			{
				PhoneApplicationPage arg_1F_0;
				if ((arg_1F_0 = this.phoneApplicationPage_0) == null)
				{
					arg_1F_0 = (this.phoneApplicationPage_0 = this.RootVisual.smethod_0(false));
				}
				return arg_1F_0;
			}
		}
		internal Frame RootVisual
		{
			get
			{
				Frame arg_22_0;
				if ((arg_22_0 = this.frame_0) == null)
				{
					arg_22_0 = (this.frame_0 = (Application.get_Current().get_RootVisual() as Frame));
				}
				return arg_22_0;
			}
		}
		internal Panel PopupContainer
		{
			get
			{
				if (this.panel_0 == null)
				{
					IEnumerable<ContentPresenter> enumerable = this.RootVisual.smethod_1(false);
					for (int i = 0; i < Enumerable.Count<ContentPresenter>(enumerable); i++)
					{
						IEnumerable<Panel> enumerable2 = Enumerable.ElementAt<ContentPresenter>(enumerable, i).smethod_1(false);
						if (Enumerable.Count<Panel>(enumerable2) > 0)
						{
							this.panel_0 = Enumerable.First<Panel>(enumerable2);
							break;
						}
					}
				}
				return this.panel_0;
			}
		}
		public DialogService()
		{
			this.AnimationType = DialogService.AnimationTypes.Slide;
		}
		private void method_0()
		{
			Grid grid = new Grid();
			grid.set_Name(Guid.NewGuid().ToString());
			this.panel_1 = grid;
			Grid.SetColumnSpan(this.panel_1, 2147483647);
			Grid.SetRowSpan(this.panel_1, 2147483647);
			if (this.BackgroundBrush != null)
			{
				this.panel_1.set_Background(this.BackgroundBrush);
			}
			if (SystemTray.get_IsVisible() && SystemTray.get_Opacity() < 1.0 && SystemTray.get_Opacity() > 0.0)
			{
				this.VerticalOffset += 32.0;
			}
			this.panel_1.set_Margin(new Thickness(0.0, this.VerticalOffset, 0.0, 0.0));
			this.panel_1.set_Opacity(0.0);
			if (this.PopupContainer != null)
			{
				this.PopupContainer.get_Children().Add(this.panel_1);
				this.panel_1.get_Children().Add(this.Child);
				return;
			}
			this.bool_0 = true;
			this.RootVisual.add_Loaded(new RoutedEventHandler(this.method_1));
		}
		private void method_1(object sender, RoutedEventArgs e)
		{
			this.RootVisual.remove_Loaded(new RoutedEventHandler(this.method_1));
			this.bool_0 = false;
			this.Show();
		}
		protected internal void SetAlignmentsOnOverlay(HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment)
		{
			if (this.panel_1 != null)
			{
				this.panel_1.set_HorizontalAlignment(horizontalAlignment);
				this.panel_1.set_VerticalAlignment(verticalAlignment);
			}
		}
		public void Show()
		{
			bool flag = false;
			try
			{
				Action action = null;
				DialogService.Class26 @class = new DialogService.Class26();
				@class.dialogService_0 = this;
				object obj;
				Monitor.Enter(obj = DialogService.object_0, ref flag);
				this.IsOpen = true;
				try
				{
					this.method_0();
				}
				catch (Exception)
				{
					return;
				}
				if (!this.bool_0)
				{
					if (!this.IsBackKeyOverride)
					{
						this.Page.add_BackKeyPress(new EventHandler<CancelEventArgs>(this.OnBackKeyPress));
					}
					this.Page.get_NavigationService().add_Navigated(new NavigatedEventHandler(this.method_2));
					switch (this.AnimationType)
					{
					case DialogService.AnimationTypes.Slide:
						@class.storyboard_0 = (XamlReader.Load("\r\n        <Storyboard  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\r\n            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=\"(UIElement.RenderTransform).(TranslateTransform.Y)\">\r\n                <EasingDoubleKeyFrame KeyTime=\"0\" Value=\"150\"/>\r\n                <EasingDoubleKeyFrame KeyTime=\"0:0:0.35\" Value=\"0\">\r\n                    <EasingDoubleKeyFrame.EasingFunction>\r\n                        <ExponentialEase EasingMode=\"EaseOut\" Exponent=\"6\"/>\r\n                    </EasingDoubleKeyFrame.EasingFunction>\r\n                </EasingDoubleKeyFrame>\r\n            </DoubleAnimationUsingKeyFrames>\r\n            <DoubleAnimation Storyboard.TargetProperty=\"(UIElement.Opacity)\" From=\"0\" To=\"1\" Duration=\"0:0:0.350\">\r\n                <DoubleAnimation.EasingFunction>\r\n                    <ExponentialEase EasingMode=\"EaseOut\" Exponent=\"6\"/>\r\n                </DoubleAnimation.EasingFunction>\r\n            </DoubleAnimation>\r\n        </Storyboard>") as Storyboard);
						this.panel_1.set_RenderTransform(new TranslateTransform());
						break;
					case DialogService.AnimationTypes.SlideHorizontal:
						@class.storyboard_0 = (XamlReader.Load("\r\n        <Storyboard  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\r\n            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=\"(UIElement.RenderTransform).(TranslateTransform.X)\" >\r\n                    <EasingDoubleKeyFrame KeyTime=\"0\" Value=\"-150\"/>\r\n                    <EasingDoubleKeyFrame KeyTime=\"0:0:0.35\" Value=\"0\">\r\n                        <EasingDoubleKeyFrame.EasingFunction>\r\n                            <ExponentialEase EasingMode=\"EaseOut\" Exponent=\"6\"/>\r\n                        </EasingDoubleKeyFrame.EasingFunction>\r\n                    </EasingDoubleKeyFrame>\r\n                </DoubleAnimationUsingKeyFrames>\r\n            <DoubleAnimation Storyboard.TargetProperty=\"(UIElement.Opacity)\" From=\"0\" To=\"1\" Duration=\"0:0:0.350\" >\r\n                <DoubleAnimation.EasingFunction>\r\n                    <ExponentialEase EasingMode=\"EaseOut\" Exponent=\"6\"/>\r\n                </DoubleAnimation.EasingFunction>\r\n            </DoubleAnimation>\r\n        </Storyboard>") as Storyboard);
						this.panel_1.set_RenderTransform(new TranslateTransform());
						break;
					default:
						@class.storyboard_0 = (XamlReader.Load("<Storyboard xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\r\n            <DoubleAnimation BeginTime=\"0:0:0\" Duration=\"0\" To=\".5\"\r\n                                Storyboard.TargetProperty=\"(UIElement.Projection).(PlaneProjection.CenterOfRotationY)\" />\r\n            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=\"(UIElement.Projection).(PlaneProjection.RotationX)\">\r\n                <EasingDoubleKeyFrame KeyTime=\"0\" Value=\"-30\"/>\r\n                <EasingDoubleKeyFrame KeyTime=\"0:0:0.35\" Value=\"0\">\r\n                    <EasingDoubleKeyFrame.EasingFunction>\r\n                        <ExponentialEase EasingMode=\"EaseOut\" Exponent=\"6\"/>\r\n                    </EasingDoubleKeyFrame.EasingFunction>\r\n                </EasingDoubleKeyFrame>\r\n            </DoubleAnimationUsingKeyFrames>\r\n            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=\"(UIElement.Opacity)\">\r\n                <DiscreteDoubleKeyFrame KeyTime=\"0\" Value=\"1\" />\r\n            </DoubleAnimationUsingKeyFrames>\r\n        </Storyboard>") as Storyboard);
						this.panel_1.set_Projection(new PlaneProjection());
						break;
					}
					if (@class.storyboard_0 != null)
					{
						Dispatcher arg_131_0 = this.Page.get_Dispatcher();
						if (action == null)
						{
							action = new Action(@class.method_0);
						}
						arg_131_0.BeginInvoke(action);
					}
					if (this.eventHandler_1 != null)
					{
						this.eventHandler_1.Invoke(this, null);
					}
				}
			}
			finally
			{
				if (flag)
				{
					object obj;
					Monitor.Exit(obj);
				}
			}
		}
		private void method_2(object sender, NavigationEventArgs e)
		{
			this.Hide();
		}
		public void Hide()
		{
			if (!this.IsOpen)
			{
				return;
			}
			if (this.Page != null)
			{
				this.Page.remove_BackKeyPress(new EventHandler<CancelEventArgs>(this.OnBackKeyPress));
				this.Page.get_NavigationService().remove_Navigated(new NavigatedEventHandler(this.method_2));
				this.phoneApplicationPage_0 = null;
			}
			Storyboard storyboard;
			switch (this.AnimationType)
			{
			case DialogService.AnimationTypes.Slide:
				storyboard = (XamlReader.Load("\r\n        <Storyboard  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\r\n            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=\"(UIElement.RenderTransform).(TranslateTransform.Y)\">\r\n                <EasingDoubleKeyFrame KeyTime=\"0\" Value=\"0\"/>\r\n                <EasingDoubleKeyFrame KeyTime=\"0:0:0.25\" Value=\"150\">\r\n                    <EasingDoubleKeyFrame.EasingFunction>\r\n                        <ExponentialEase EasingMode=\"EaseIn\" Exponent=\"6\"/>\r\n                    </EasingDoubleKeyFrame.EasingFunction>\r\n                </EasingDoubleKeyFrame>\r\n            </DoubleAnimationUsingKeyFrames>\r\n            <DoubleAnimation Storyboard.TargetProperty=\"(UIElement.Opacity)\" From=\"1\" To=\"0\" Duration=\"0:0:0.25\">\r\n                <DoubleAnimation.EasingFunction>\r\n                    <ExponentialEase EasingMode=\"EaseIn\" Exponent=\"6\"/>\r\n                </DoubleAnimation.EasingFunction>\r\n            </DoubleAnimation>\r\n        </Storyboard>") as Storyboard);
				break;
			case DialogService.AnimationTypes.SlideHorizontal:
				storyboard = (XamlReader.Load("\r\n        <Storyboard  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\r\n            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=\"(UIElement.RenderTransform).(TranslateTransform.X)\">\r\n                <EasingDoubleKeyFrame KeyTime=\"0\" Value=\"0\"/>\r\n                <EasingDoubleKeyFrame KeyTime=\"0:0:0.25\" Value=\"150\">\r\n                    <EasingDoubleKeyFrame.EasingFunction>\r\n                        <ExponentialEase EasingMode=\"EaseIn\" Exponent=\"6\"/>\r\n                    </EasingDoubleKeyFrame.EasingFunction>\r\n                </EasingDoubleKeyFrame>\r\n            </DoubleAnimationUsingKeyFrames>\r\n            <DoubleAnimation Storyboard.TargetProperty=\"(UIElement.Opacity)\" From=\"1\" To=\"0\" Duration=\"0:0:0.25\">\r\n                <DoubleAnimation.EasingFunction>\r\n                    <ExponentialEase EasingMode=\"EaseIn\" Exponent=\"6\"/>\r\n                </DoubleAnimation.EasingFunction>\r\n            </DoubleAnimation>\r\n        </Storyboard>") as Storyboard);
				break;
			default:
				storyboard = (XamlReader.Load("<Storyboard xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\r\n            <DoubleAnimation BeginTime=\"0:0:0\" Duration=\"0\" \r\n                                Storyboard.TargetProperty=\"(UIElement.Projection).(PlaneProjection.CenterOfRotationY)\" \r\n                                To=\".5\"/>\r\n            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=\"(UIElement.Projection).(PlaneProjection.RotationX)\">\r\n                <EasingDoubleKeyFrame KeyTime=\"0\" Value=\"0\"/>\r\n                <EasingDoubleKeyFrame KeyTime=\"0:0:0.25\" Value=\"45\">\r\n                    <EasingDoubleKeyFrame.EasingFunction>\r\n                        <ExponentialEase EasingMode=\"EaseIn\" Exponent=\"6\"/>\r\n                    </EasingDoubleKeyFrame.EasingFunction>\r\n                </EasingDoubleKeyFrame>\r\n            </DoubleAnimationUsingKeyFrames>\r\n            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=\"(UIElement.Opacity)\">\r\n                <DiscreteDoubleKeyFrame KeyTime=\"0\" Value=\"1\" />\r\n                <DiscreteDoubleKeyFrame KeyTime=\"0:0:0.267\" Value=\"0\" />\r\n            </DoubleAnimationUsingKeyFrames>\r\n        </Storyboard>") as Storyboard);
				break;
			}
			try
			{
				if (storyboard != null)
				{
					storyboard.add_Completed(new EventHandler(this.method_3));
					using (IEnumerator<Timeline> enumerator = storyboard.get_Children().GetEnumerator())
					{
						while (enumerator.MoveNext())
						{
							Timeline current = enumerator.get_Current();
							Storyboard.SetTarget(current, this.panel_1);
						}
					}
					storyboard.Begin();
				}
			}
			catch (Exception)
			{
				this.method_3(null, null);
			}
		}
		private void method_3(object sender, EventArgs e)
		{
			this.IsOpen = false;
			if (this.PopupContainer != null)
			{
				this.PopupContainer.get_Children().Remove(this.panel_1);
			}
			if (this.eventHandler_0 != null)
			{
				this.eventHandler_0.Invoke(this, null);
			}
		}
		public void OnBackKeyPress(object sender, CancelEventArgs e)
		{
			if (this.HasPopup)
			{
				e.set_Cancel(true);
				return;
			}
			if (this.IsOpen)
			{
				e.set_Cancel(true);
				this.Hide();
			}
		}
	}
}
